﻿Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Public Partial Class WebForm_DatetimePicker
	Inherits System.Web.UI.UserControl
	Protected Sub Page_Load(sender As Object, e As EventArgs)

	End Sub
End Class

Public Partial Class WebForm_DatetimePicker

	Public Property DateTimeValue() As System.Nullable(Of DateTime)
		Get
			Dim myDateTime As System.Nullable(Of DateTime) = Nothing

			Try

				myDateTime = Convert.ToDateTime(String.Format("{0} {1}:{2}:00", txtDate.Text, ddlHour.SelectedValue, ddlMinute.SelectedValue))
			Catch
			End Try


			Return myDateTime
		End Get
		Set
			Dim myDateTime As System.Nullable(Of DateTime) = value

			If myDateTime.HasValue Then
				txtDate.Text = myDateTime.Value.ToString("yyyy/MM/dd")
				ddlHour.SelectedValue = myDateTime.Value.Hour.ToString()
				ddlMinute.SelectedValue = myDateTime.Value.Minute.ToString()

			End If
		End Set
	End Property



	Public WriteOnly Property ValidationGroup() As String
		Set
			chk_txtDate.ValidationGroup = value

			chk_txtDate2.ValidationGroup = value
		End Set
	End Property




	Public WriteOnly Property RequiredErrorMessage() As String
		Set
			chk_txtDate.ErrorMessage = value
		End Set
	End Property

	Public WriteOnly Property FormateErrorMessage() As String
		Set
			chk_txtDate2.ErrorMessage = value
		End Set
	End Property



End Class